package com.hnx.admin.aurora.system.mapper.dept;

import com.hnx.admin.aurora.annotation.AddInfo;
import com.hnx.admin.aurora.annotation.UpdateInfo;
import com.hnx.admin.aurora.system.domain.dto.dept.entity.DeptDTO;
import com.hnx.admin.aurora.system.domain.param.dept.form.DeptForm;
import com.hnx.admin.aurora.system.domain.param.dept.query.DeptQuery;
import com.hnx.admin.aurora.web.json.TreeNodeVO;
import org.apache.ibatis.annotations.Param;
import org.apache.ibatis.annotations.Select;
import org.apache.ibatis.annotations.Update;

import java.util.List;

public interface DeptMapper {
    DeptDTO getDeptByUserId(String userId);
    List<DeptDTO> selectDeptList(DeptQuery dept);

    List<TreeNodeVO> selectDeptTreeList(Object o);

    List<String> selectDeptListByRoleId(@Param("roleId")String roleId,@Param("deptCheckStrictly") boolean deptCheckStrictly);
    @AddInfo
    int insertDept(DeptForm dept);

    DeptDTO selectDeptById(String deptId);
    @Update("update sys_dept set del_flag = '2' where dept_id = #{deptId}")
    int deleteDeptById(String deptId);
    @Select("select count(1) from sys_emp where dept_id = #{deptId}")
    boolean checkDeptExistUser(String deptId);
    @UpdateInfo
    int updateDept(DeptForm dept);
}
